home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld 1999 May
/
Macworld (1999-05).dmg
/
Demo⁄free XPress XTensions
/
XPressImage demo
/
AppleScripts
/
XPressImage.HotFolder.as
next >
Wrap
Text File
|
1999-02-22
|
2KB
|
45 lines
-- checkFolder() - This function (or "subroutine") watches a folder
-- for files. If someone has dropped files into the folder, then
-- this function will process the file and move it to the out folder.
-- but be careful to check to see if the files are finished copying into
-- FolderToWatch before acting on them.
-- ------------------------------------------------------------
property FolderToWatch : "Macintosh HD:XpressImageHot:" -- insert your folder path name here
property FolderToPut : "Macintosh HD:XpressImageHot:" -- insert your folder path name here
property numFiles : "" -- number of files in folder
property theContents : {} -- contents of folder
property oldContents : {} -- contents of folder
-- ----------------subroutine-----------------------------------
on run
idle of me
end run
-- Does FolderToWatch have files in it?
-- If it does, then we give a green light.
on idle
set theContents to list folder FolderToWatch
set folderStatusChanged to true
tell application "Finder"
set numFiles to the number of files in folder FolderToWatch
if numFiles = 0 then
set folderStatusChanged to false
end if
end tell
if folderStatusChanged = true then
repeat with x in theContents
if x is not in oldContents then
set oldContents to oldContents & x & return
set theFile to FolderToWatch & x
tell application "QuarkXPress™"
activate
open alias theFile use doc prefs yes
GLUON XpressImage "1,3,5"
close document 1
end tell
end if
end repeat
end if
oldContents = theContents
return 1 * 10
end idle